﻿namespace UFIDA.U9.Learn.ItemBP
{
	using System;
	using System.Collections.Generic;
	using System.Text; 
	using UFSoft.UBF.AopFrame;	
	using UFSoft.UBF.Util.Context;
    using UFSoft.UBF.Util.DataAccess;

    /// <summary>
    /// QCGuideUpdate partial 
    /// </summary>	
    public partial class QCGuideUpdate 
	{	
		internal BaseStrategy Select()
		{
			return new QCGuideUpdateImpementStrategy();	
		}		
	}
	
	#region  implement strategy	
	/// <summary>
	/// Impement Implement
	/// 
	/// </summary>	
	internal partial class QCGuideUpdateImpementStrategy : BaseStrategy
	{
		public QCGuideUpdateImpementStrategy() { }

		public override object Do(object obj)
		{						
			QCGuideUpdate bpObj = (QCGuideUpdate)obj;

            if (bpObj.QCSchema == null)
            {
				throw new Exception("传入参数为空");
            }

			foreach(var dto in bpObj.QCSchema)
            {
				string sql = $"update QC_QCSchema set DescFlexField_PrivateDescSeg1='更新完成' where ID='{dto.ID}'";
				DataAccessor.RunSQL(DataAccessor.GetConn(), sql, null);
            }
			return bpObj.QCSchema.Count;
		}		
	}

	#endregion
	
	
}